const Message = require("../models/Message")
const Admin = require("../models/Admin");

exports.addMessage = async function (messageObj) {
    const ins = await Message.create(messageObj)
    if (ins) {
        const result = await Message.findAll({
            include: [Admin],
            order:[["id","DESC"]]
        });
        return result;
    }
}

exports.getYhly = async function () {
    const result = await Message.findAll({
        include: [Admin],
        order:[["id","DESC"]]
    });
    return result;
}